#!/bin/bash
MainPst=/sd/record_data
if [ -e "${MainPst}" ];then
   cd ${MainPst}
   if [ $(ls -l | wc -l) -gt 5 ]
     then
     echo "file > 5"
     rm -r $(ls -rt | head -n1)
   fi
   rosbag record /GPS_fix /Ser_imu /Ser_odom /camera/rgb/image_raw /Location_pose /tf /tf_static
else
   echo "file path error"
fi
